<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();//取项目名
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+
            request.getServerPort()+path+"/";//取协议 主机名 端口
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <base href="<%=basePath%>"><!-- base修改当前页面的上下文 ,无论当前实际目录是什么 相对路径都从项目根目录开始算，因为当前basePath的值是当前目录-->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script type="text/javascript" src="static/js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="static/js/jquery.validate.js"></script>
    <script type="text/javascript" src="static/js/messages_zh.js"></script>
    <script type="text/javascript" src="static/js/member/addValidate.js"></script>
    <script type="text/javascript" src="static/js/member/add.js"></script>
    <script type="text/javascript">

        $(function(){
            $("#signupForm1").validate({
                rules: {
                    sno: {
                        required: true,
                        minlength: 6
                    },
                    name: {
                        required: true,
                        minlength: 4
                    }
                },
                messages: {
                    sno: {
                        required: "请输入学号",
                        minlength: "学号不能短于6个字符"
                    },
                    name: {
                        required: "请输入用户名",
                        minlength: "用户名不能短于4个字符"
                    }
                }
            });
            $.validator.setDefaults({
                submitHandler: function() {
                    $("#signupForm1").submit();
                }
            });
        });

    </script>
</head>
<body>
<div class="form">
  <form id="signupForm1" action="StudentS" method="post">
   <div><span class="txtspan">学号</span><input class="inputtext"  type = "text" name="sno"></div>
   <div><span class="txtspan">姓名</span><input id="name" class="inputtext" type = "text" name="name"></div>
   <div><span class="txtspan">性别</span>
   
  男<input class="inputradio" type = "radio" name="sex" value="男">
   女<input class="inputradio" type = "radio" name="sex" value="女">
   
   </div>

   <input id='btnSub' type = "submit" value="提交">
  </form>
</div>



</body>
</html>